/*子应用*/
const express = require('express');

const query = require('../pool');

const product = express.Router();
//获取到蛋糕的评论
product.post('/comment',async(req,res)=>{
  let obj = req.body;
//console.log(obj)
  let result =await query(`select * from cake_review  where trade_name="${obj.names}";`
  );
  if(result.length==0){
    res.send({code:0,msg:'未查询到相关结果'})
  }else{
    res.send({code:1,msg:'搜索成功',data:result})
//console.log(result)
  }
})
//暴露
module.exports = product;
